package com.zff.rental.utils.specification;

import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Predicate;

import java.util.Collection;

/**
 * @author HCY
 */
public class InCollectionPre<Root, PathV> extends BasePre<Root, PathV, Collection<?>> {
    public InCollectionPre(String name, Collection<?> params) {
        super(name, params);
    }

    @Override
    protected Predicate generate(CriteriaBuilder cb, Path<PathV> path, Collection<?>[] params) {
        return path.in(params[0]);
    }
}
